<?php

class HtmlCompressorPlugin extends Zend_Controller_Plugin_Abstract
{
    /**
     * Compress html code.
     * Called before Zend_Controller_Front exits its dispatch loop.
     *
     * @return void
     */
    public function dispatchLoopShutdown()
    {
    	return;
    	// Not compress in Debug mode
    	if (Debug::getInstance()->isDebugMode()) {
    		return;
    	}
    	
    	$compressor = new FaZend_View_Filter_HtmlCompressor();
    	
    	$response = $this->getResponse();
    	$body = $response->getBody();
    	$body = $compressor->filter($body);
    	$response->setBody($body);
    }
			
}